#ifndef __LIBLOG_H__
#define __LIBLOG_H__

namespace purewell
{

class PWLibLog
{
public:
	static PWLibLog& getInstance(void);
public:
	void format(const char* fmt, ...);
	void trace(const char* file, int line, const char* func,
		const char* fmt, ...);

	std::ostream* setStream(std::ostream* os);
	std::ostream* getStream(void);

public:
	virtual ~PWLibLog();

private:
	explicit PWLibLog();
	PWLibLog& operator = (const PWLibLog& v) { return *this; }


private:
	std::ostream* m_os;

};

extern PWLibLog& gLibLog;

#ifdef WIN32
#	define _PWTRACE(fmt,...) gLibLog.trace(__FILE__,__LINE__,__FUNCTION__,fmt,__VA_ARGS__)
#else
#	define _PWTRACE(fmt,...) gLibLog.trace(__FILE__,__LINE__,__func__,fmt,__VA_ARGS__)
#endif//WIN32

};//namespace purewell


#endif//!__LIBLOG_H__

